/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.me.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Jayasundara
 */
@Entity
@Table(name = "fix_version", catalog = "postgres", schema = "public")
@NamedQueries({@NamedQuery(name = "FixVersion.findAll", query = "SELECT f FROM FixVersion f"), @NamedQuery(name = "FixVersion.findById", query = "SELECT f FROM FixVersion f WHERE f.id = :id")})
public class FixVersion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @JoinColumn(name = "task_id", referencedColumnName = "id")
    @ManyToOne
    private Task taskId;
    @JoinColumn(name = "version_id", referencedColumnName = "id")
    @ManyToOne
    private Versions versionId;

    public FixVersion() {
    }

    public FixVersion(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Task getTaskId() {
        return taskId;
    }

    public void setTaskId(Task taskId) {
        this.taskId = taskId;
    }

    public Versions getVersionId() {
        return versionId;
    }

    public void setVersionId(Versions versionId) {
        this.versionId = versionId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FixVersion)) {
            return false;
        }
        FixVersion other = (FixVersion) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.me.entity.FixVersion[id=" + id + "]";
    }

}
